<template>
  <div class="container" @click="handleClickGallary">
    <div class="wrapper">
      <swiper :options="swiperOption" v-if="1">
        <swiper-slide v-for="(item,key) in imgs" :key="key">
          <img class="swiper-img"  :src="item">
        </swiper-slide>
        <div class="swiper-pagination"  slot="pagination"></div>
      </swiper>
    </div>

  </div>
</template>

<script>
export default {
  name: 'CommonGallary',
  props: {
    imgs: Array
  },
  methods: {
    handleClickGallary: function () {
      console.log(this.$emit)
      this.$emit('close')
    }
  },
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        paginationType: 'fraction',
        loop: true,
        autoplay: 3000,
        observer: true,
        observeParents: true
      }
    }
  },
  watch: {
    imgs () {
      console.log('imgs')
      console.log(typeof this.imgs)
      console.log(this.imgs)
    }
  }
}
</script>
<style scoped lang="stylus">
.container
  position:fixed;
  left:0
  right:0
  top:0
  bottom:0
  background:#ccc
  display:flex
  flex-direction: column
  justify-content:center
  z-index:3
  .wrapper
    width:100%
    overflow:hidden
    .swiper-img
      width:100%
    .swiper-pagination
      color:#fff
</style>
